package run.bottle.app.security.handler;

import run.bottle.app.exception.AbstractBottleException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author Lycheng
 */
public class ContentAuthenticationFailureHandler implements AuthenticationFailureHandler {
    @Override
    public void onFailure(HttpServletRequest request, HttpServletResponse response, AbstractBottleException exception) throws IOException, ServletException {

        // Forward to error
        request.getRequestDispatcher(request.getContextPath() + "/error").forward(request, response);

    }
}
